package cn.tedu.mapper;

import cn.tedu.pojo.Novel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface NovelMapper extends BaseMapper<Novel> {

    @Select("select n.id,novel_title,novel_author from novel n " +
            "join collect c on c.novel_id = n.id " +
            "where n.status = true " +
            "and c.user_id =#{userId}")
    List<Novel> getNovelByUserId(Integer userId);
}
